﻿<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>控制台</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<!-- basic styles -->
		<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
		<link href="assets/css/font-awesome.min.css" rel="stylesheet" />


		<!-- ace styles -->

		<link rel="stylesheet" href="assets/css/ace.min.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="assets/css/ace-skins.min.css" />

		<script src="assets/js/ace-extra.min.js"></script>

		<style type="text/css">
			
			body {
				overflow: hidden;
			}
			.tab-content {
				border: none;
				padding: 10px 0px;
			}

			#menu_li_0 {
				display: none;
			}
		</style>

	</head>

	<body>
		<div class="navbar navbar-default" id="navbar">
			<script type="text/javascript">
				try{ace.settings.check('navbar' , 'fixed')}catch(e){}
			</script>

			<div class="navbar-container" id="navbar-container">
				<div class="navbar-header pull-left">
					<a href="#" class="navbar-brand">
						<small>
							<i class="icon-cogs"></i>
							后台管理系统
						</small>
					</a><!-- /.brand -->
				</div><!-- /.navbar-header -->

				<div class="navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">
						<li class="purple">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<i class="icon-bell-alt icon-animated-bell"></i>
								<span class="badge badge-important">8</span>
							</a>

							<ul class="pull-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-close">
								<li class="dropdown-header">
									<i class="icon-warning-sign"></i>
									8条通知
								</li>

								<li>
									<a href="#">
										<div class="clearfix">
											<span class="pull-left">
												<i class="btn btn-xs no-hover btn-pink icon-comment"></i>
												新闻评论
											</span>
											<span class="pull-right badge badge-info">+12</span>
										</div>
									</a>
								</li>

								<li>
									<a href="#">
										<i class="btn btn-xs btn-primary icon-user"></i>
										切换为编辑登录..
									</a>
								</li>

								<li>
									<a href="#">
										<div class="clearfix">
											<span class="pull-left">
												<i class="btn btn-xs no-hover btn-success icon-shopping-cart"></i>
												新订单
											</span>
											<span class="pull-right badge badge-success">+8</span>
										</div>
									</a>
								</li>

								<li>
									<a href="#">
										<div class="clearfix">
											<span class="pull-left">
												<i class="btn btn-xs no-hover btn-info icon-twitter"></i>
												粉丝
											</span>
											<span class="pull-right badge badge-info">+11</span>
										</div>
									</a>
								</li>

								<li>
									<a href="#">
										查看所有通知
										<i class="icon-arrow-right"></i>
									</a>
								</li>
							</ul>
						</li>

						<li class="light-blue">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<img class="nav-user-photo" src="assets/avatars/user.jpg" alt="Jason's Photo" />
								<span class="user-info">
									<small >已登录</small>
									<p id="userLogName"></p>
								</span>

								<i class="icon-caret-down"></i>
							</a>

							<ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li class="divider"></li>

								<li>
									<a href="javascript:void(0)" onclick="logout()">
										<i class="icon-off"></i>
										退出
									</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>
			</div>
		</div>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<div class="sidebar" id="sidebar">
					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
					</script>
					<ul class="nav nav-list" id="menu">
					</ul>
					<div class="sidebar-collapse" id="sidebar-collapse">
						<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
					</div>
					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
					</script>
				</div>

				<div class="main-content">
					<div class="page-content" style="padding: 0px !important;">
						<div class="row" style="margin-right:0px !important;margin-left: 0px !important;">
							<div class="col-xs-12" style="padding: 0px 2px 0px 2px">
								<ul class="nav nav-tabs" role="tablist">
			      				</ul>
			      				<div class="tab-content">
			      				</div>

							</div>
						</div>
					</div>
				</div>

			</div>
		</div>
		<script src='assets/js/jquery-2.0.3.min.js'></script>
		<!-- 自定义js -->
		<script src="assets/js/sidebar-menu.js"></script>
		<script src="assets/js/bootstrap-tab.js"></script>
		<script src="assets/js/bootstrap.min.js"></script>
		<script src="assets/js/typeahead-bs2.min.js"></script>
		<script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script>
		<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="assets/js/jquery.slimscroll.min.js"></script>
		<script src="assets/js/jquery.easy-pie-chart.min.js"></script>
		<script src="assets/js/jquery.sparkline.min.js"></script>
		<script src="assets/js/flot/jquery.flot.min.js"></script>
		<script src="assets/js/flot/jquery.flot.pie.min.js"></script>
		<script src="assets/js/flot/jquery.flot.resize.min.js"></script>
		<script src="assets/js/ace-elements.min.js"></script>
		<script src="assets/js/ace.min.js"></script>
		<script type="text/javascript" src="assets/js/jquery.cookie.js" ></script>
		<script type="text/javascript" src="assets/js/common.js"></script>
		<script src="../../assets/js/myUrl.js" type="text/javascript"></script>

		<script type="text/javascript">
			$(window).resize(function() {
			  	$("#sidebar").height($(window).height()-$("#navbar").height());
			  	$("div .tab-pane iframe").height($("#sidebar").height());
			});

			$(function () {
				userInfo();
				$("#sidebar").height($(window).height()-$("#navbar").height());
				 var url = "/api/auth/getUserUrl";
				 var header = null;
                if($.cookie("myToken")){
					header = {"Authorization": "Bearer "+$.cookie("myToken")}
                }
                $.ajax({
                    type: "GET",
                    url: url,
                    data: null,// 要提交的表单
					headers: header,
                    success: function (msg) {
                    	console.info(msg.data);
                        $('#menu').sidebarMenu({data: msg.data});
                    },
                    error: function (error) {
                        if(error.status=='401'){
                            layer.alert('请重新登陆', {
                                icon: 2,
                                title: "请求提示"
                            })
                            window.location.href="/login.html";
                        }else {
                            layer.alert('请求错误', {
                                icon: 2,
                                title: "请求提示"
                            })
                        }

                    }
                })

                eval($("#menu_li_00 a").attr("href"));
			  });
			
			function userInfo() {
				var resulut = myAjax(null, local_url.user_login_info, "GET");
				console.info(resulut)
				if(resulut.code==200){
					$("#userLogName").append(resulut.data.username);
				}
			}
			
			function logout() {
				$.cookie('myToken', null);
				window.location.href="/login.html";
			}
		</script>
</body>
</html>

